assert "It Is A Very Beautiful Day!" ==
    ("it is a VERY beautiful day!".replaceAll(/\w+/,
        { it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1].toLowerCase() : '') }))


def before='''
apple
orange
y
banana
'''

def expected='''
Apple
Orange
Y
Banana
'''

assert expected == before.replaceAll(/(?m)^\w+/,
    { it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1] : '') })



import org.codehaus.jackson.map.ObjectMapper;
def jsonMapper = new ObjectMapper();


def m = "foobarfoo foobarfoo" =~ /o(b.*r)f/

println m.size()
m.each { println it }
''


